package com.alks.function.controller.pcFactoryQuery;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.factoryquery.PartStockRequest;
import com.alks.function.service.pcfactoryquery.IPcSlipDetailPartBfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@ApiRestController("/pcFactorQuery")
@Api(value = "总经办", tags = "总经办-工厂查询模块-耗品库存查询")
@Slf4j
@RoleCheck(prgIds = {"100414", "150211", "160212", "170511", "180712"})
public class PartMtlStkController {
    @Autowired
    private IPcSlipDetailPartBfService partBfService;

    @PutMapping("/queryPartBfStockHead")
    @ApiOperation(value = "耗品库存-耗品库存主表-条件可分页查询", tags = "总经办-工厂查询模块-耗品库存查询")
    @WebLogger
    public ResponseInfo queryPartBfStockHead(@RequestBody PartStockRequest result) {
        return partBfService.queryPartBfStockHead(result);
    }

    @GetMapping("/queryPartBfStockDetail/{mtlNo}")
    @ApiOperation(value = "耗品库存-耗品库存明细-条件查询", tags = "总经办-工厂查询模块-耗品库存查询")
    @WebLogger
    public ResponseInfo queryPartBfStockDetail(@PathVariable("mtlNo") String mtlNo) {
        return partBfService.queryPartBfStockDetail(mtlNo);
    }

    @GetMapping("/queryPartBfStockBack")
    @ApiOperation(value = "耗品库存-耗品库存-回表查询", tags = "总经办-工厂查询模块-耗品库存查询")
    @WebLogger
    public ResponseInfo queryPartBfStockBack() {
        return partBfService.queryPartBfStockBack();
    }

}
